#ifndef MATRIX_H
#define MATRIX_H

#include <stdio.h>

void
matrixOnesInit(float* M, int width)
{
	int count = width * width;

	for (int i = 0; i < count; i++)
	{
		M[i] = 1.0;
	}
}

void
matrixRandInit(float* M, int width)
{
	int count = width * width;

	for (int i = 0; i < count; i++)
	{
		M[i] = rand()/128.0;
	}
}

void
matrixZeroInit(float* M, int width)
{
	int count = width * width;

	for (int i = 0; i < count; i++)
	{
		M[i] = 0.0;
	}
}

void
printMatrix(float* M, int width)
{
	for (int i = 0; i < width; i++)
	{
		for (int j = 0; j < width; j++)
		{
			printf("%f\t", M[i*width + j]);
		}

		printf("\n");
	}

	printf("\n");
}

#endif // MATRIX_H
